package com.ketangpai.controller;

import com.ketangpai.entity.User;
import com.ketangpai.entity.request.LoginRequest;
import com.ketangpai.entity.response.BaseResponse;
import com.ketangpai.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author jiahao
 * @date 2024/2/14 20:08
 */
@RestController
public class LoginController {
    @Autowired
    LoginService loginService;
    @PostMapping("/login")
    public BaseResponse login(@RequestBody LoginRequest loginRequest) {
        return loginService.login(loginRequest.getAccount(), loginRequest.getPassword());
    }
 }
